package com.pms.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.pms.entity.Document;
import com.pms.entity.Project;
import com.pms.service.NewDocumentService;
import com.pms.util.GetSession;

public class DocumentServlet extends HttpServlet {


	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setCharacterEncoding("UTF-8");
		
		Project pro = (Project)GetSession.getSession(request).getAttribute("pro");
		String proid=pro.getPro_id();
		
		
		NewDocumentService newDocService = new NewDocumentService();
		List<Document> list = newDocService.findByProId(proid);
		
		
		GetSession.getSession(request).setAttribute("docList", list);
		request.getRequestDispatcher("/WEB-INF/document.jsp").forward(request, response);
		
	
	}

}
